from flask import Blueprint,request,jsonify
import json
from db import db1
from utils.acl import acl
from config import get_data
from utils.rs import rs
from utils.jwttoken import jwta
import datetime
bp_zuoye=Blueprint('zuoye',__name__)

# 登录
@bp_zuoye.route('/denglu',methods=['POST'])
def denglu():
    data=get_data()
    username=data['username']
    sql="select * from xiao_user"
    res=db1.find(sql)
    if res['username']==username:
        if data['password']==res['password']:
            return jsonify({'msg':"登录成功",'id':res['id']})
    return jsonify({'msg':'账号密码错误'})
